<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
    <th:block th:include="include :: header('修改承运商管理')" />
</head>
<body class="white-bg">
    <div class="wrapper wrapper-content animated fadeInRight ibox-content">
        <form class="form-horizontal m" id="form-carriers-edit" th:object="${basisCarriers}">
            <input name="id" th:field="*{id}" type="hidden">
            <div class="form-group">    
                <label class="col-sm-3 control-label is-required">承运商编码：</label>
                <div class="col-sm-8">
                    <input name="carriersCode" th:field="*{carriersCode}" class="form-control" type="text" maxlength="16" required readonly>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label is-required">承运商名称：</label>
                <div class="col-sm-8">
                    <input name="carriersName" th:field="*{carriersName}" class="form-control" type="text" maxlength="30" required>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label is-required">联系人：</label>
                <div class="col-sm-8">
                    <input name="contactPerson" th:field="*{contactPerson}" class="form-control" type="text" maxlength="6" required>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label is-required">电话：</label>
                <div class="col-sm-8">
                    <input name="telephone" th:field="*{telephone}" class="form-control" type="text" maxlength="16" required>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">手机：</label>
                <div class="col-sm-8">
                    <input name="mobilePhone" th:field="*{mobilePhone}" class="form-control" type="text" maxlength="11">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">邮箱：</label>
                <div class="col-sm-8">
                    <input name="email" th:field="*{email}" class="form-control" type="text" maxlength="50" >
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label is-required">地址：</label>
                <div class="col-sm-8">
                    <input name="address" th:field="*{address}" class="form-control" type="text" maxlength="100" required>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label is-required">级别：</label>
                <div class="col-sm-8">
                    <select name="carriersLevel" class="form-control" th:with="type=${@dict.getType('wms_level')}" required>
                        <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{carriersLevel}"></option>
                    </select>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">备注：</label>
                <div class="col-sm-8">
                    <textarea name="remark" class="form-control" maxlength="200">[[*{remark}]]</textarea>
                </div>
            </div>
        </form>
    </div>
    <th:block th:include="include :: footer" />
    <script th:inline="javascript">
        var prefix = ctx + "basis/carriers";
        $("#form-carriers-edit").validate({
            onkeyup: false,
            rules:{
                email:{
                    email:true,
                },
                mobilePhone:{
                    isPhone:true,
                },
            },
            messages: {
                "email": {
                    remote: "Email格式不对"
                },
                "mobilePhone":{
                    remote: "手机号码格式不对"
                },
            },
            focusCleanup: true
        });

        function submitHandler() {
            if ($.validate.form()) {
                $.operate.save(prefix + "/edit", $('#form-carriers-edit').serialize());
            }
        }
    </script>
</body>
</html>